package util;


import dao.UserDAO;
import dao.UserDaoJdbcImpl;
import modle.User;

/**
 * 1、用于登录时对用户账号密码的验证
 * 
 * @author Lzx
 *
 */
public class Inter {
	public static User inter(String na, String pw) {
		UserDAO usd = new UserDaoJdbcImpl();
		User user = usd.readUser(na);
//		System.out.println( use.getAccount() + " " + use.getPassword() );
		try {
			if( user.getAccount() != null ) {
				if( pw.equals( user.getPassword() ) ) {
					return user;
				}
			}
		} catch (Exception e) {
			return null;
		}
		return null;
	}
}
